﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>学校管理</title>
	<link rel="stylesheet" href="css/common2.css">
	<link rel="stylesheet" href="css/urlty.css">
	<style>
		.search_img {
			position: absolute;
			margin-top: -35px;
			right: -27%;
		}
		.table {
			width: 100%;
			margin-left: 0;
		}
	</style>

</head>


<body>
	<div id="vue-root" style="border: 1px solid rgba(200,200,200,0.01);">

		<div class="search_box" style="margin-top: 50px;">
			<div class="add">
				<a href="school_item.html" style="color: white">添加学校</a>
			</div>
			<div class="refresh" onclick="location.reload()">刷新</div>

			<div class="agent">
				<select class="search" id="Agent" v-model="search.active" style="margin-top: -35px;right:  356px;">
					<option :value="undefined">半年内有/无考勤</option>
					<option value="true">半年内有考勤</option>
					<option value="false">半年内无考勤</option>
				</select>
			</div>
			<input class="search" placeholder="请输入合作校区名称" v-model="search.name"
				style="margin-top: -35px;right: 73px; height: 33px; max-width: 300px;" v-on:keyup.enter="getData0">
			<div class="agent">
				<select class="search" id="Agent" v-model="search.agentId" style="margin-top: -35px;right: 30px;">
					<option :value="undefined">请选择代理商</option>
					<option v-for="(agent,index) in agents" v-text="agent.name" :key="agent.id" :value="agent.id">
					</option>
				</select>
			</div>
			<div class="agent">
				<select class="search" id="type" v-model="search.campusStatus" style="margin-top: -35px;right: -7%;">
					<option :value="undefined">请选择类型</option>
					<option value="1">未选址</option>
					<option value="2">已选址未成功</option>
					<option value="3">已选址未装修</option>
					<option value="4">装修中</option>
					<option value="5">试营业中</option>
					<option value="6">已开业</option>
					<option value="7">已停业</option>
					<option value="8">已退款</option>
					<option value="9">已解约</option>
					<option value="10">待维权</option>
				</select>
			</div>
			<input class="search" placeholder="请输入合作人姓名" v-model="search.linkman"
				style="margin-top: -35px;right: -15%; height: 33px; max-width: 118px;" v-on:keyup.enter="getData0">
				<input class="search" placeholder="请输入合同编号" v-model="search.file"
				style="margin-top: -35px;right: -23%; height: 33px; max-width: 118px;" v-on:keyup.enter="getData0">
			<img src="image/search.png" height="35" width="35" class="search_img" @click="getData0">
		</div>
		<br>

		<div class="table" style="margin-top: -30px;width: 96%; overflow: auto; ">
			<table class="table_top">
				<thead>
					<tr>
						<th>
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th>序号</th>
						<th>代理商</th>
						<th class="school-name">学校名称</th>
						<th>管理专员</th>
						<th>校区帐号</th>
						<th>合作人名称</th>
						<th>联系电话</th>
						<th class="school-name">省/市/区</th>
						<th>目标学校</th>
						<th>品牌/运营、押金金额</th>
						<th>财务状态</th>
						<th>校区状态</th>
						<th>合同编号</th>
						<th>签约时间</th>
						<th>合同剩余时间</th>
						<th>最后跟进时间</th>
						<th>验收状态</th>
						<th>最后登录时间</th>
						<!--学校类型-->
						<th>创建时间</th>
						<th>学校入口</th>
						<th>编辑/删除</th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(school,index) in list" :key="school.id">
						<td>
							<input type="checkbox" class="check-box" v-model="school.checked">
						</td>
						<td><span v-text="index+1"></span></td>
						<td v-text="school.agentName"></td>
						<td class="two school-name" v-text="school.name"></td>
						<!-- 管理专员 -->
						<td v-text="school.id"></td>
						<td v-text="school.username"></td>
						<td v-text="school.linkman"></td>
						<td v-text="school.contactInfo"></td>
						<td class="two school-name" :title="school.areaName" v-text="school.areaName"></td>
						<td v-text="school.targetSchool"></td>
						<td v-text=""></td>
						<td v-text=""></td>
						<td v-text="statusMap[school.campusStatus]"></td>
						<td v-text="school.file"></td>
						<td v-text="school.startTime"></td>
						<td v-text=""></td>
						<td v-text=""></td>
						<td v-text=""></td>
						<td v-text=""></td>
						<td v-text="createTime(school)"></td>
						<td>
							<button class="hut_but_tz" @click="loginSchool(school.id)">进入学校</button>
						</td>
						
						<td>
							<div class="option">
								<div class="edit-icon option-icon" @click="edit(school.id)"
									style="position: absolute; left: 20%; top: 30%;">
									<img class="img" src="../image/edit.png" height="20" width="20"
										onmouseover="this.src='image/edit_light.png'"
										onmouseout="this.src='image/edit.png'" />
								</div>
								<div class="delete-icon option-icon" @click="del([school.id])"
									style="right: 20%; top:30%;position: absolute;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='image/delete_light.png'"
										onmouseout="this.src='image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>

				</tbody>
			</table>
		</div>
		<div class="delete" @click="batchDelete" v-if="total>1">批量删除</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
			<li>
				<a v-text="pages"></a>
				<!--页面总数-->
			</li>
		</ul>
		<div style="float: right;margin-bottom: 20px;">
			总共{{total}}条记录
			<select class="ui-select init" style="height:32px" v-model="pageSize">
				<!--style="margin-top: 14px;"-->
				<option :value="10">每页10条</option>
				<option :value="30">每页30条</option>
				<option :value="100">每页100条</option>
			</select>
		</div>
	</div>

	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/scriptZIP/dayjs.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>
	<script>
		var app = new Vue(merge({
			data: {
				statusMap: {
        '1': '未选址',
        '2': '已选址未成功',
        '3': '已选址未装修',
        '4': '装修中',
        '5': '试营业中',
        '6': '已开业',
        '7': '已停业',
        '8': '已退款',
        '9': '已解约',
        '10': '待维权'
    },
				urls: {
					list: '/pc/school/list',
					del: '/pc/school/del'
				},
				agents: [],
				types: [],
				search: {
					active: params().active
				},
			},
			created: function () {
				this.getData();
				axios.get('/pc/agent/all').then(function (res) {
					this.agents = res.data;
				}.bind(this));
				axios.get('/pc/school/types').then(function (res) {
					this.types = res.data;
				}.bind(this));
			},
			methods: {
				loginSchool: function (id) {
					open("/school/school_menu.html?id=" + id, '_blank');
				},
				edit: function (id) {
					location.href = "school_item.html?id=" + id;
				},
				createTime: function (school) {
					return dayjs(school.id / 4096 + 1.56E12).format('YYYY-MM-DD HH:mm:ss');
				}
			}
		}));
	</script>
</body>

</html>